<?php 
$cs=Yii::app()->clientScript;
$cs->registerScript('customer_business_dialog_view',<<<END
$(document).bind('keydown',function(e){if(e.keyCode==27){parent.$.modal.close();}});
$("a[href=#]").click(function(){
	\$parent=$(window.parent.document);
	if('{$_GET['rt']}'=='create'){
		\$parent.find("#Business_detail_customer_name").val($(this).text()).removeClass('error').next('span').remove();
		\$parent.find("#Business_detail_fk_customer_id").val($(this).attr('class'));
	}
	else{
		\$parent.find("#c_name").val($(this).text());
	}
	parent.$.modal.close();
	return false;
});
END
)
?>
<?php echo CHtml::beginForm(array($this->action->id));?>
<div  style="padding-left:30px">
	客户名称：<input type="text" name="keys[name]" size="20" value="<?php echo isset($_GET['keys']['name'])?$_GET['keys']['name']:'';?>"/>
	模糊查询：<input type="radio" name="keys[blur]" value="1" checked/>是  
	<input type="radio" name="keys[blur]" value="0" <?php echo isset($_GET['keys']['blur'])&&$_GET['keys']['blur']==0?'checked':'';?>/>否
	<input type="hidden" name="rt" value="<?php echo $_GET['rt'];?>"/> 
	<input type="submit" value="搜索"/>
</div>
<?php echo CHtml::endForm();?>
<table class="dataGrid"  width=90%>
  <tbody>
  	<tr>
<?php foreach($models as $n=>$model): ?>
	<?php if($n>1&&$n%4==0) echo '</tr><tr>';?>
    <td><?php echo CHtml::link($model->name,'#',array('class'=>$model->id)); ?></td>
<?php endforeach; ?>
	</tr>
  </tbody>
</table>
<br/>
<?php $this->widget('CLinkPager',array('pages'=>$pages,'maxButtonCount'=>Yii::app()->params['dialog'][$this->action->id]['maxButtonCount'])); ?>